<template>
  <div class="ybl">
    <h3 class="m10px" v-html="'工序管理'" />
    <div class="x p10px wf">
      <el-button type="primary" v-html="'新增'" @click="form=$cp(defForm);show = !show" />
    </div>
    <div class="ybl p10px">
      <el-table :data="tabData" border stripe highlight-current-row class="fg1" height="100">
        <el-table-column type="index" label="行号" width="80" />
        <el-table-column prop="id" label="id" width="180" />
        <el-table-column prop="name" label="名称" width="180" />
        <el-table-column label="操作" width="180">
          <template slot-scope="scope">
            <el-button
              type="primary"
              @click="form=scope.row; show=!show"
              v-html="'修改'"
              size="mini"
            />
          </template>
        </el-table-column>
        <el-table-column prop="other.remarks" label="备注" />
      </el-table>
    </div>
    <fy :value="$gd.process" @change="tabData=$event" />
    <processA :fshow="show" :form="form" @change="change" />
  </div>
</template>

<script>
import processA from "../components/create/processA.vue";
import fy from "../components/fy";
export default {
  components: { processA, fy },
  // props: [],
  data() {
    return {
      show: false,
      tabData: [],
      form: {},
      defForm: { name: "", other: { remarks: "" }, state: 1 }
    };
  },
  watch: {},
  created() {},
  methods: {
    change(a, b, c) {
      switch (a) {
        case 201:
          if (c) {
            this.$gd.process.push(b);
          }
          break;

        default:
          break;
      }
    }
  }
};
</script>

